package com.yuwj.chinaa.adapter;

import android.content.Context;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yuwj.chinaa.R;
import com.yuwj.chinaa.entity.EntityAssetGTETransactionRecord;
import com.yuwj.chinaa.entity.EntityAssetGTKTransactionRecord;

import java.util.List;

/**
 * assetFragment里面的钱包记录adapter
 */
public class GTETransactionRecordAdapter extends BaseQuickAdapter<Object, BaseViewHolder> {
    Context context;

    public GTETransactionRecordAdapter(Context context, List<Object> datas) {
        super(R.layout.item_asset_transaction_record, datas);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder holder, final Object item) {
        if (item instanceof EntityAssetGTETransactionRecord) {
            EntityAssetGTETransactionRecord gteTransactionRecord = (EntityAssetGTETransactionRecord) item;
            holder.setText(R.id.tv_count, gteTransactionRecord.getAmount() + "");
            holder.setText(R.id.tv_state, gteTransactionRecord.getStatus() + "");
            holder.setText(R.id.tv_time, gteTransactionRecord.getOperateDate() + "");
        } else if (item instanceof EntityAssetGTKTransactionRecord) {
            EntityAssetGTKTransactionRecord gtkTransactionRecord = (EntityAssetGTKTransactionRecord) item;
            holder.setText(R.id.tv_count, gtkTransactionRecord.getAmount() + "");
            holder.setText(R.id.tv_state, gtkTransactionRecord.getStatus() + "");
            holder.setText(R.id.tv_time, gtkTransactionRecord.getOperateDate() + "");
        }
    }

}
